<template>
  <div class="tab-content">
    <div class="w-[765px] pt-[10px]">
      <el-form
        ref="ruleForm"
        :v-loading="loading"
        :model="form"
        :rules="rules"
        label-position="left"
        hide-required-asterisk
      >
        <!--  配套介绍 -->
        <el-form-item label="" prop="supportingDesc" class="row-all">
          <template #label>
            <div>配套介绍</div>
          </template>
          <el-input
            v-model="form.supportingDesc"
            :disabled="disabled"
            type="textarea"
            :rows="3"
            maxlength="300"
            show-word-limit
            placeholder="300字以内文字描述"
          ></el-input>
        </el-form-item>

        <!-- 基础设施 -->
        <el-form-item label="" prop="infrastructure" class="row-all">
          <template #label>
            <div class="flex space-x-4 my-4">
              <span>基础设施</span>
              <div>
                <i class="el-icon-warning-outline text-primary" />
                <span class="text-main-content">点击图标，选择现有配套设施</span>
              </div>
            </div>
          </template>
          <Infrastructure :data-list.sync="form.infrastructure" />
        </el-form-item>
      </el-form>
    </div>

    <Save :disabled="loading" @onPreview="handlePreview" @onSave="handleSave" />
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import addEditMixin from '../common/addEditMixin'
import Save from '../common/Save.vue'
import Infrastructure from '@/components/admin/manage/carrier/common/Infrastructure/index.vue'

const defaultForm = {
  supportingDesc: null,
  infrastructure: [],
}
export default Vue.extend({
  components: { Infrastructure, Save },
  mixins: [addEditMixin({ defaultForm, templateName: 'B_CONSOLE_PARK' })],
  props: {
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      form: { ...defaultForm },
      rules: {},
    }
  },
  head: {
    title: '产业配套',
  },
})
</script>
<style lang="scss" scoped>
@import '@/assets/scss/form.scss';
</style>
